XWIKI-10330: Allow reinstalling an extension from an extension reposi…#5383
Open
XWIKI-10330: Allow reinstalling an extension from an extension reposi…#5383
Conversation
…tory in the extension manager
tmortagne
reviewed
Apr 16, 2026
| * @return true if the extension was removed or not present, false on error | ||
| * @since 18.3.0RC1 | ||
| */ | ||
| public boolean removeExtension(String id, String version) |
Member
There was a problem hiding this comment.
It's IMO not a good idea to provide such a dangerous helper (if the passed extension is still installed, it will create quite a mess since the extension will still be found in the installed extension index in memory but not in the storage). If you really need that hack (but I don't think it's the right direction here), you can always use the already existing getRepository() script API.
tmortagne
reviewed
Apr 16, 2026
|
|
||
| #macro (computeReinstallPlan $extensionId $extensionVersion $extensionNamespace) | ||
| ## Remove from local cache to force a fresh download (useful for snapshot versions) | ||
| #set ($discard = $services.extension.local.removeExtension($extensionId, $extensionVersion)) |
Member
There was a problem hiding this comment.
After this line the installed extension is essentially broken. So if you don't validate the proposed plan, you are left in a pretty bad state. Creating an installation plan should be a readonly thing. Also, any change like this should be part of a job IMO.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…tory in the extension manager
Jira URL
https://jira.xwiki.org/browse/XWIKI-10330
Changes
Description
This is the change in platform. There's also a PR for commons.
Coded by Claude Code. To be reviewed/validated.
Screenshots & Video
Executed Tests
Manual testing in EM to reinstall an extension after a change was made.
Expected merging strategy